package com.ruoyi.qiushi.service.user.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.qiushi.mapper.user.MemberUserFamilyMapper;
import com.ruoyi.qiushi.domain.user.MemberUserFamily;
import com.ruoyi.qiushi.service.user.IMemberUserFamilyService;

/**
 * 用户关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-15
 */
@Service
public class MemberUserFamilyServiceImpl implements IMemberUserFamilyService 
{
    @Autowired
    private MemberUserFamilyMapper memberUserFamilyMapper;

    /**
     * 查询用户关系
     * 
     * @param id 用户关系主键
     * @return 用户关系
     */
    @Override
    public MemberUserFamily selectMemberUserFamilyById(Long id)
    {
        return memberUserFamilyMapper.selectMemberUserFamilyById(id);
    }

    /**
     * 查询用户关系列表
     * 
     * @param memberUserFamily 用户关系
     * @return 用户关系
     */
    @Override
    public List<MemberUserFamily> selectMemberUserFamilyList(MemberUserFamily memberUserFamily)
    {
        return memberUserFamilyMapper.selectMemberUserFamilyList(memberUserFamily);
    }

    /**
     * 新增用户关系
     * 
     * @param memberUserFamily 用户关系
     * @return 结果
     */
    @Override
    public int insertMemberUserFamily(MemberUserFamily memberUserFamily)
    {
        memberUserFamily.setCreateTime(DateUtils.getNowDate());
        return memberUserFamilyMapper.insertMemberUserFamily(memberUserFamily);
    }

    /**
     * 修改用户关系
     * 
     * @param memberUserFamily 用户关系
     * @return 结果
     */
    @Override
    public int updateMemberUserFamily(MemberUserFamily memberUserFamily)
    {
        memberUserFamily.setUpdateTime(DateUtils.getNowDate());
        return memberUserFamilyMapper.updateMemberUserFamily(memberUserFamily);
    }

    /**
     * 批量删除用户关系
     * 
     * @param ids 需要删除的用户关系主键
     * @return 结果
     */
    @Override
    public int deleteMemberUserFamilyByIds(Long[] ids)
    {
        return memberUserFamilyMapper.deleteMemberUserFamilyByIds(ids);
    }

    /**
     * 删除用户关系信息
     * 
     * @param id 用户关系主键
     * @return 结果
     */
    @Override
    public int deleteMemberUserFamilyById(Long id)
    {
        return memberUserFamilyMapper.deleteMemberUserFamilyById(id);
    }
}
